@extends('layout.index')

@section('title', '链接管理')

@section('content')
<div class="mws-panel grid_8">
  <div class="mws-panel-header">
    <span>
      <i class="icon-table"></i>链接列表</span>
  </div>
  <div class="mws-panel-body no-padding">
    <div role="grid" class="dataTables_wrapper" id="DataTables_Table_1_wrapper">
      <form action="/admin/link/index" method="get">
          <div id="DataTables_Table_1_length" class="dataTables_length">
            <label>显示
              <select name="num" size="1" aria-controls="DataTables_Table_1">
                <option value="10" @if(!empty($request['num']) && $request['num'] == 10)
                                        selected
                                    @endif>10</option>
                <option value="25" @if(!empty($request['num']) && $request['num'] == 25)
                                        selected
                                    @endif>25</option>
                <option value="50" @if(!empty($request['num']) && $request['num'] == 50)
                                        selected
                                    @endif>50</option>
                <option value="100" @if(!empty($request['num']) && $request['num'] == 100)
                                        selected
                                    @endif>100</option>
                </select>条
            </label>
          </div>
          <div class="dataTables_filter" id="DataTables_Table_1_filter">
            <label>关键字:
              <input name="keywords" value="{{$request['keywords'] or ''}}"type="text" aria-controls="DataTables_Table_1">
              <button class="btn btn_default">查询</button>
            </label>
          </div>
      </form>
        <table id="DataTables_Table_0" class="mws-datatable mws-table dataTable" aria-describedby="DataTables_Table_0_info">
              <thead>
                <tr role="row"><th aria-label="Rendering engine: activate to sort column descending" aria-sort="ascending" style="width: 174px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_0" tabindex="0" role="columnheader" class="sorting_asc">id</th><th aria-label="Browser: activate to sort column ascending" style="width: 225px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_0" tabindex="0" role="columnheader" class="sorting">链接名</th><th aria-label="Platform(s): activate to sort column ascending" style="width: 211px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_0" tabindex="0" role="columnheader" class="sorting">链接地址</th><th aria-label="Engine version: activate to sort column ascending" style="width: 147px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_0" tabindex="0" role="columnheader" class="sorting">操作</th></tr>
            </thead>
            
              <tbody aria-relevant="all" aria-live="polite" role="alert">
              @foreach($links as $k=>$v)
                <tr class="@if($k%2 == 0)
                            odd
                            @else
                            even
                            @endif">
                  <td class="  sorting_1">{{$v->id}}</td>
                  <td class=" ">{{$v->name}}</td>
                  <td class=" ">{{$v->address}}</td>
                  <td class=" ">　　　　　<a href="/admin/link/edit/{{$v->id}}" style="color:black;"><i class="icon-tools"></i>修改</a>|
                <a href="/admin/link/delete/{{$v->id}}" style="color:black"><i class="icon-trash"></i>删除</a></td>
                </tr>
                @endforeach
              </tbody>
        </table>
    </div>
  </div>
</div>
@endsection